<%@ Page Language="VB" AutoEventWireup="false" Theme="myTheme" MasterPageFile="~/masterPage.master"
    CodeFile="Default.aspx.vb" Inherits="_Default" %>

<%@ Register Src="~/UserCuntrols/footer.ascx" TagName="footer" TagPrefix="uc1" %>
<%@ Register Src="~/UserCuntrols/TopMenu.ascx" TagName="TopMenu" TagPrefix="uc1" %>
<%@ Register Src="~/UserCuntrols/AddRatator.ascx" TagName="AddRatator" TagPrefix="uc1" %>
<%@ Register Src="~/UserCuntrols/CustomDropDown.ascx" TagName="CustomDropDown" TagPrefix="uc1" %>
<asp:Content ContentPlaceHolderID="_head" runat="server" ID="head">

    <script language="javascript" type="text/javascript">
    searchKeyPress = function(e){
        if(!e) var e = window.event;

        if(e.keyCode == 13){
            $('<%=btnSearch.ClientID %>').click();
            return false;
        }
    };
    </script>

</asp:Content>
<asp:Content ContentPlaceHolderID="_main" runat="server">
    <asp:UpdatePanel ID="UpdatePanelFrame" runat="server" RenderMode="Inline">
        <ContentTemplate>
            <asp:Image ID="imgFrame" runat="server" Style="position: absolute;" BorderWidth="0"
                ImageUrl="~/images/background.gif" Height="90%" Width="99.8%" ImageAlign="AbsMiddle" />
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click"></asp:AsyncPostBackTrigger>
        </Triggers>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="UpdateProgressYahoo" runat="server" AssociatedUpdatePanelID="UpdatePanelYahoo">
        <ProgressTemplate>
            <div id="loader" class="loader" align="center">
                <img src="<%=ResolveUrl("~/images/loading-spinner.gif") %>" alt="Loading..." /><span
                    id="loaderText" class="loaderText">Loading...</span>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdateProgress ID="UpdateProgresssubmit" runat="server" AssociatedUpdatePanelID="UpdatePanelsubmit">
        <ProgressTemplate>
            <div id="loader" class="loader" align="center">
                <img src="<%=ResolveUrl("~/images/loading-spinner.gif") %>" alt="Loading..." /><span
                    id="loaderText" class="loaderText">Loading...</span>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <div style="width: 100%; position: absolute;" align="center">
        <asp:UpdatePanel ID="UpdatePanelSpacer" runat="server" RenderMode="Inline">
            <ContentTemplate>
                <asp:Image ID="imgBlank" runat="server" ImageUrl="~/images/spacer.gif" Width="1"
                    Height="180" />
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click"></asp:AsyncPostBackTrigger>
            </Triggers>
        </asp:UpdatePanel>
        <asp:Panel ID="Panel1" runat="server">
        </asp:Panel>
        <asp:Panel ID="search" Style="width: 100%;" runat="server" CssClass="aspPanel" HorizontalAlign="Center">
            <uc1:TopMenu ID="topMenu1" runat="server" SelectedTab="Image" />
            <div id="divSearch" align="center">
                <asp:UpdatePanel ID="UpdatePanel2" runat="server" RenderMode="Inline">
                    <ContentTemplate>
                        <div style="margin-bottom: 10px; margin-top: -22px;">
                            <asp:Label ID="lblSearch" runat="server" Text="SafeSearch is off"></asp:Label>
                            <asp:LinkButton ID="lnksafeSearch" runat="server" Text="turn on"></asp:LinkButton>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <asp:TextBox runat="server" ID="txtKeyword" CssClass="aspTextBox" Text="" ToolTip="Place your keyword to search"></asp:TextBox>

                <script language="javascript" type="text/javascript">
                $('<%=txtKeyword.ClientID %>').onkeypress = searchKeyPress;
                </script>

                <asp:UpdatePanel ID="UpdatePanelsubmit" runat="server" RenderMode="Inline">
                    <ContentTemplate>
                        <asp:ImageButton ImageUrl="~/images/GigitiButton4.gif" Style="margin-top: -5px;"
                            runat="server" ToolTip="Click to search specified keyword" AlternateText="Search"
                            ID="btnSearch" Width="63" Height="33" ImageAlign="AbsMiddle" />
                        <div style="margin-top: -10px;">
                            <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="<br />Please enter keyword"></asp:CustomValidator>
                        </div>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click"></asp:AsyncPostBackTrigger>
                    </Triggers>
                </asp:UpdatePanel>
                <div style="float: left; margin-top: -17px; width: 100%;">
                    <center>
                        <asp:Image ID="logoPoweredby" runat="server" ImageUrl="~/images/yahoo.gif" Height="20"
                            AlternateText="Powered by" ToolTip="Powered by" />
                    </center>
                </div>
            </div>
            <div style="float: left; width: 100%; margin-left: -50px;" align="center">
            </div>
        </asp:Panel>
    </div>
    <!-- End Search Panel -->
    <!-- Begin Yahoo  Image Result Panel -->
    <div style="width: 100%; position: absolute; top: 250px" align="center">
        <asp:UpdatePanel ID="UpdatePanelYahoo" runat="server" RenderMode="Inline">
            <ContentTemplate>
                <asp:Panel ID="googleImageResult" runat="server" Visible="false">
                    <asp:DataList ID="yahooImageRes" runat="server" RepeatColumns="5" RepeatDirection="Horizontal"
                        Width="100%" CellSpacing="10">
                        <HeaderStyle CssClass="datagridHeader" />
                        <ItemTemplate>
                            <div align="center">
                                <a target="_self" href='<%#Eval ("Url")%>'>
                                    <img style="max-width: 140px; max-height: 100px; border: 0px;" src='<%#Eval("Image")%>' /></a>
                            </div>
                            <div align="center" style="color: #000000;">
                                <%#Eval("Summary") %>
                                <br />
                                <%#Eval("Width")%>
                                x
                                <%#Eval("Height")%>
                                -
                                <%#Eval("FileSize") %>
                                -
                                <%#Eval("FileFormat") %>
                                <br />
                                <%#Eval("RefererUrl") %>
                            </div>
                        </ItemTemplate>
                    </asp:DataList>
                    <br />
                    <br />
                    <div align="center">
                        <asp:LinkButton ID="lnkYahooPrev" runat="server" Style="color: #A0A0A0; font-weight: bold;
                            text-decoration: none;">&lt; Prev</asp:LinkButton>
                        <asp:LinkButton ID="lnkYahooNext" runat="server" Style="color: #A0A0A0; font-weight: bold;
                            text-decoration: none;">Next &gt;</asp:LinkButton>
                        <span style="padding-left: 20px;">
                            <asp:Literal ID="litYahooSearchCount" runat="server"></asp:Literal></span>
                    </div>
                </asp:Panel>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click"></asp:AsyncPostBackTrigger>
                <asp:AsyncPostBackTrigger ControlID="lnkYahooNext" EventName="Click"></asp:AsyncPostBackTrigger>
                <asp:AsyncPostBackTrigger ControlID="lnkYahooPrev" EventName="Click"></asp:AsyncPostBackTrigger>
            </Triggers>
        </asp:UpdatePanel>
        <asp:UpdatePanel ID="UpdatePanelHyperlinkBottom" runat="server" RenderMode="Inline">
            <ContentTemplate>
                <br />
                <asp:Panel ID="pnlHyperlinkBottom" runat="server" Visible="false" HorizontalAlign="Center">
                    <uc1:AddRatator ID="ads" runat="server" XMLFile="~/XML/Advertisements2.xml" />
                    <br />
                </asp:Panel>
                <asp:Panel ID="pnlImage" runat="server" align="center" Style="padding: 5px;" Width="100%"
                    Visible="false">
                    <uc1:footer ID="footer2" runat="server" />
                </asp:Panel>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click"></asp:AsyncPostBackTrigger>
                <asp:AsyncPostBackTrigger ControlID="lnkYahooNext" EventName="Click"></asp:AsyncPostBackTrigger>
                <asp:AsyncPostBackTrigger ControlID="lnkYahooPrev" EventName="Click"></asp:AsyncPostBackTrigger>
            </Triggers>
        </asp:UpdatePanel>
    </div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline">
        <ContentTemplate>
            <asp:Panel ID="pnlImage1" runat="server" align="center" Style="position: absolute;
                bottom: 10px;" Width="100%">
                <uc1:footer ID="footer1" runat="server" />
            </asp:Panel>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click"></asp:AsyncPostBackTrigger>
        </Triggers>
    </asp:UpdatePanel>
    <script language="javascript">
    document.getElementById("<%=txtKeyword.ClientId %>").focus();
    </script>
</asp:Content>
